The disclosed embodiments of the present invention relate to performing parity check upon data stored in a content addressable memory (CAM) device, and more particularly, to a method and apparatus for controlling a parity check function of a CAM device which supports a partial write operation (e.g., a write mask function).
An essential semiconductor device is a semiconductor memory, such as a random access memory (RAM). A RAM allows a memory circuit to execute both read and write operations on its memory cells. Typical examples of RAM devices include the dynamic random access memory (DRAM) and the static random access memory (SRAM). Another form of the memory is a content addressable memory (CAM). A CAM device is a memory device that accelerates any application requiring a fast search of a database. The CAM device compares input search data against a table of stored data, and returns the address of the matched data. In other words, in the CAM device, stored data within a CAM array is not accessed by initially supplying an address, but rather by initially applying the input search data (e.g., a search word) to the CAM array and then performing a compare operation to identify one or more row locations (i.e., entry addresses) within the CAM array that contain data equivalent to the applied input search data and thereby represent a “match” condition. In this manner, stored data is accessed according to its content rather than its address. Hence, the CAM device is a good choice for implementing a lookup operation due to its fast search capability. For example, due to their unique searching algorithms, the CAM devices are frequently employed in network equipment (particularly, routers and switches), computer systems and other devices that require rapid content searching.
As mentioned above, the main function of the CAM device is data comparison based on data stored in the CAM array composed of a plurality of CAM cells, where each CAM cell may include an SRAM cell and a compare circuit. However, in the manufacture process, it is possible that the CAM array may have one or more faulty/defective CAM cells which fail to perform their intended functionality. Suppose that the CAM with faulty/defective CAM cells is used to store look-up table data and then perform data comparison. If the input search data is identical to data stored into a specific entry/row with faulty/defective CAM cell(s), the CAM device may fail to identify the specific entry/row as having a match condition due to the faulty/defective CAM cell(s).
To detect the existence of faulty/defective CAM cell(s) in each entry/row of the CAM device, a parity check function may be implemented to check correctness of write data actually stored in each CAM entry/row. However, it is possible that the CAM device may support a write mask function which performs a byte write operation to partially update write data stored in a CAM entry/row. As the parity data is generally generated while original write data is stored into the CAM entry/row, applying parity check to the partially updated write data according to the parity data generated based on the original write data would fail to achieve the intended purpose of checking correctness of the write data actually stored in the CAM entry/row.